package com.example.demo.mapper;

import com.example.demo.domain.entity.TrainingProblem;
import com.example.demo.domain.entity.VojProblems;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.dto.ProblemViewDto;
import com.example.demo.dto.ProgrammingQuestionDTO;
import com.example.demo.dto.SolveProblemCountDto;
import com.example.demo.param.voj.VojProblemQueryParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 00774904
* @description 针对表【voj_problems】的数据库操作Mapper
* @createDate 2023-11-30 19:22:39
* @Entity com.example.demo.domain.entity.VojProblems
*/
public interface VojProblemsMapper extends BaseMapper<VojProblems> {

    List<ProblemViewDto> list(@Param("param") VojProblemQueryParam param,
                              @Param("uid") Long uid,
                              @Param("companyId") Long companyId,
                              @Param("offset") Long offset);

    Integer countList(@Param("param") VojProblemQueryParam param,
                   @Param("companyId") Long companyId);

    TrainingProblem detail(@Param("id") Long id);

    List<ProblemViewDto> getProblemByIds(@Param("ids") List<Long> ids);

    List<SolveProblemCountDto> getProblemCountGroupByProblemTag();

    List<ProgrammingQuestionDTO> getProgrammingByRandom(@Param("limit") Integer limit);

    List<ProgrammingQuestionDTO> getByCreatorId(@Param("creatorId") Long creatorId, @Param("companyId") Long companyId);

}




